#ifndef FRESHDIALOG_H
#define FRESHDIALOG_H

#include <BXmlNode>
#include <BXmlDocument>
#include <BTreeWidget>
#include <BTextEdit>
#include <BTableWidget>
#include <BButton>
#include <BFile>
#include <BLabel>
#include <BDialog>
#include <BSpacer>

using namespace BWE;

class CheckDialog : public BDialog
{
public:
	CheckDialog(BWidget* parent = 0);
	~CheckDialog();

	bool openHeadFile(const BString& headFileName);
	bool loadHtmlFile(const BString& htmlFileName);
	bool save();

protected:
	int strideBlock(const BString& text, int pos);
	void collectMembers(BXmlNode* body, const BString& text, int& pos);
	BXmlNode* createEnumTable(const BString& text, int& pos);

protected:
	void slotItemSelected(BObject* object, const BValue& value);
	void slotSave();
	void slotCancel();

protected:
	virtual void updateEvent(const BEvent& event);

private:
	BString				_fileName;
	BString				_htmlFileName;
	BXmlNodeHolder		_headRoot;

	BTreeWidget*		_treeWidget;
	BLabel*				_titleLabel;
	BTextEdit*			_attribEdit;
	BTextEdit*			_textEdit;

	BButton*			_saveButton;
	BButton*			_cancelButton;
};

#endif
